
<template>
	<dialogBody @confirm="confirm" @cancel="cancel" ref="body">
		<template slot="title">添加</template>
		<div style="padding-top: 15px;">
			<div class="formContainer">
				<mapselect :inputDefault="Defaultlocation" :oldMarker="oldMarker" @mapclick="pointChange($event)"
				@addr="addrChange" ref="mapsec"></mapselect>
			</div>
		</div>
	</dialogBody>
</template>

<script>
	import dialogBody from '@/components/module/dialog/dialogBody.vue'
	import datePicker from '@/components/module/universal/datePicker.vue'
	import mapselect from '@/components/module/map/selectPoint.vue'
	export default {
		components: {
			dialogBody,
			datePicker,
			mapselect,
		},
		props: {},
		data() {
			return {
				callback: undefined,
				location: '',
				Defaultlocation: '',
				oldMarker:''
			}
		},
		computed: {},
		watch: {},
		created(){},
		mounted() {
		},
		methods: {
			addMap(){
				//this.$refs.mapsec.show()
			},
			pointChange(data){
				//this.$emit('location', data)
				this.location=data
			},
			addrChange(){},
			confirm() {
				this.$emit('location', this.location)
				this.close()
			},
			cancel() {
				this.close()
			},
			close() {
				this.$refs.body.hide()
			},
			open(data,callBack) {
				this.callback = callBack
				this.$refs.body.open()
			},
			keydownFloat(ev) {
				if(ev.keyCode == 109 || ev.keyCode == 229){
					ev.preventDefault()
				}
			},
		}
	}
</script>
<style scoped>
	.formContainer{
		margin-bottom: 12px;
	}
	
	.formContainer>label{
		min-width: 72px;
		text-align: right;
		display: inline-block;
		margin-right: 12px;
		line-height: 32px;
	}
	
	.formContainer>label>span{
		display: inline-block;
		width: 8px;
	}
	
	.required{
		color: red;
	}
	>>>.datepickerContainer{
		margin: 0 auto;
	}
</style>